package com.yysjyr.logisticssystem.common;

import com.yysjyr.logisticssystem.common.contants.Contants;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author: 吃货大人
 * @date: 2023/10/5
 * @time : 18:35
 * @description: 返回结果对象
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ReturnObject {
    /**
     * @author: 吃货大人
     * @date: 2023/10/5
     * @time : 18:36
     * @param code      响应代码
     * @param message   错误消息
     * @param data      响应数据
     * @description:
     */
    private String code;
    private String message;
    private Object data;
    public static ReturnObject Ok(){
        return new ReturnObject(Contants.RETURN_OBJECT_CODE_SUCCESS,"","");
    }
    public static ReturnObject Ok(Object data){
        return new ReturnObject(Contants.RETURN_OBJECT_CODE_SUCCESS,"",data);
    }

    public static ReturnObject NO(){
        return new ReturnObject(Contants.RETURN_OBJECT_CODE_FAIL,"","");
    }
    public static ReturnObject NO(String message){
        return new ReturnObject(Contants.RETURN_OBJECT_CODE_FAIL,message,"");
    }


}
